package com.huawei.appmarket.framework.fragment;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.fragment.LoadingFragment;
import o.cgv;
import o.djm;
import o.dky.d;
import o.erq;
import o.evd;
import o.evf;
import o.ewm.c;
import o.ewm.h;
import o.ewm.j;
import o.ewm.n;
import o.fmw;

public class HasTitleLoadingFragment extends LoadingFragment implements djm, OnClickListener {
    public int ॱ() {
        return h.ߺॱ;
    }

    public View ˋ(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        String ॱ;
        CharSequence charSequence = null;
        View ˋ = super.ˋ(layoutInflater, viewGroup, bundle);
        if (ˊॱ() != null) {
            charSequence = ˊॱ().getString("loading_title", null);
        }
        if (TextUtils.isEmpty(charSequence)) {
            ॱ = ॱ(n.ॱـ);
        } else {
            CharSequence charSequence2 = charSequence;
        }
        if (evf.ˋ(ॱˋ())) {
            Object ˏ = fmw.ˏ(ॱˋ(), d.ʼॱ, "color");
            Object ˏ2 = fmw.ˏ(ॱˋ(), d.ˈ, "color");
            if ((ˏ instanceof Integer) && (ˏ2 instanceof Integer)) {
                evd.ˊ(ॱˋ(), ((Integer) ˏ).intValue(), ((Integer) ˏ2).intValue());
                if (erq.ˏ(((Integer) ˏ).intValue())) {
                    evd.ˊ(ॱˋ().getWindow(), 1);
                } else {
                    evd.ˊ(ॱˋ().getWindow(), 0);
                }
            }
        } else {
            cgv.ˋ(ॱˋ(), c.ˎ, c.ॱˎ);
        }
        ॱ(ˋ, ॱ);
        return ˋ;
    }

    protected void ॱ(View view, String str) {
        ((TextView) view.findViewById(j.ˈˉ)).setText(str);
        view.findViewById(j.ͺˏ).setOnClickListener(this);
    }

    public void ˋ(int i) {
        View view = getView();
        if (view != null) {
            view.setVisibility(i);
        }
    }

    public void onClick(View view) {
        if (view.getId() == j.ͺˏ && ॱˋ() != null) {
            ॱˋ().finish();
        }
    }

    public void ˎ(String str) {
        View view = getView();
        if (view != null) {
            ((TextView) view.findViewById(j.ˈˉ)).setText(str);
        }
    }
}
